'use strict';

module.exports = {
	/**
	 * 获取用户充值数据接口
	 * @url api/pub/data/analyzer/getRecharge 报表分析使用的url参数地址
	 * data 请求参数
	 * @param {String} params1  参数1
	 */
	main: async (event) => {
		let {
			data = {}, userInfo, util, filterResponse, originalParam
		} = event;
		let {
			customUtil,
			uniID,
			config,
			pubFun,
			vk,
			db,
			_
		} = util;
		let {
			date,
			pageIndex,
			pageSize
		} = data;
		let res = {
			code: 0,
			msg: ""
		};
		// 业务逻辑开始-----------------------------------------------------------
		if (userInfo.username == "admin") {
			res = await vk.baseDao.select({
				dbName: "report_index",
				pageIndex: pageIndex || 1, // 当前第几页
				pageSize: -1,
				whereJson: { // 条件
					date: date
				}
			});
		}




		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}
}